<?php

class orgs extends Controller {

	public function index() {
		$this->session();
		$orgs = new organization();
		$orgList = $orgs->getAllOrgs();
		$data['title'] = new BufferedView('siteadmin/titles/tOrganizations');
		$data['content'] = new BufferedView('siteadmin/organizations',array(
			"organization" => $orgList
		) );

	new View ("siteadmin/template", $data);

				
	}

	public function add() {
		$this->session();
		$data['title'] = new BufferedView('siteadmin/titles/tOrganizations');
		$data['content'] = new BufferedView('siteadmin/addOrg');

	new View ("siteadmin/template", $data);

				
	}


	public function edit($orgName) {
		$this->session();
		$orgs = new organization();
		$org = $orgs->getOrgByName($orgName);
		$data['title'] = new BufferedView('siteadmin/titles/tOrganizations');
		$data['content'] = new BufferedView('siteadmin/editOrg',array(
			"org" => $org
		) );

	new View ("siteadmin/template", $data);

				
	}

	

}
	
	